package com.olinsports.system.olinsportssystem.manager;

import com.olinsports.system.olinsportssystem.model.CommodityDetailed;
import com.olinsports.system.olinsportssystem.model.InventoryDetails;
import com.olinsports.system.olinsportssystem.service.CommodityDetailedService;
import com.olinsports.system.olinsportssystem.service.InventoryDetailsService;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/7/22.
 */
@Component
public class InventoryDetailsManager {
    @Autowired
    private InventoryDetailsService inventoryDetailsService;
    public List<InventoryDetails> selectAll(){
        return inventoryDetailsService.selectAll();
    }
    public int insertAll(InventoryDetails InventoryDetails){
        return inventoryDetailsService.insertAll(InventoryDetails);
    }
    public int deleteByKey(int detailedKey){
        return inventoryDetailsService.deleteByKey(detailedKey);
    }

    public int updateData(InventoryDetails InventoryDetails){
        return inventoryDetailsService.updateData(InventoryDetails);
    }

    public InventoryDetails selectByKey(int inventoryKey){
        return inventoryDetailsService.selectByKey(inventoryKey);
    }

    public Map listOrSearchInvent(String page, String rows, boolean _search, String sord, String sidx){
        return inventoryDetailsService.listOrSearchInvent(page,rows,_search,sord,sidx);
    }

    public int saveInventoryDetails(InventoryDetails InventoryDetails,int typekey,int detailsKey) {
        return inventoryDetailsService.saveInventoryDetails(InventoryDetails,typekey,detailsKey);
    }

    public Map searchDate(String page, String rows,String startDate,String endDate){
        return inventoryDetailsService.searchDate(page,rows,startDate,endDate);
    }
    public ModelAndView toDcExcel(String startDate, String endDate, HSSFWorkbook workbook) throws Exception{
        return inventoryDetailsService.toDcExcel(startDate,endDate,workbook);
    }
    public  List<InventoryDetails>  toExcelHttp(String startDate,String endDate){
        return inventoryDetailsService.toExcelHttp(startDate,endDate);
    }

    public Map searchSelf(String page, String rows,String field,String fieldValue){
        return inventoryDetailsService.searchSelf(page,rows,field,fieldValue);
    }

}
